import { Menu, MenuProps } from "antd";
import "../assets/sass/home_page/sidebar/sidebar.css";
<<<<<<< HEAD
import { useNavigate } from "react-router-dom";

const Sidebar = () => {
  const navgite=useNavigate()
=======
import { useLocation } from "react-router-dom";
const Sidebar = () => {
  const loaction = useLocation();

>>>>>>> 040b22f (改版)
  type MenuItem = Required<MenuProps>["items"][number];

  const items: MenuItem[] = [
    {
      key: "grp_one",
      type: "group",
      children: [
        {
<<<<<<< HEAD
          key: "/home/free_templates/shou",
=======
          key: "/home/free_templates/featcured_picks",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/home.png"></img>
          ),
          label: "精选推荐",
<<<<<<< HEAD
          
        },
        {
          key: "/home/free_templates/console",
=======
        },
        {
          key: "/home/free_templates/work_bench",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/workbench.png"></img>
          ),
          label: "工作台",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/chuangjian",
=======
          key: "13",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/devise.png"></img>
          ),
          label: "创建设计",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/pianhao",
=======
          key: "14",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/setting.png"></img>
          ),
          label: "偏好设置",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/my",
=======
          key: "15",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/collection.png"></img>
          ),
          label: "我的收藏",
        },
      ],
    },
    {
      key: "grp_two",
      type: "group",
      label: "创意设计",
      children: [
        {
<<<<<<< HEAD
          key: "/home/free_templates/H5",
=======
          key: "21",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/H_five.png"></img>
          ),
          label: "H5",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/haibao",
=======
          key: "22",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/devise.png"></img>
          ),
          label: "海报",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/changye",
=======
          key: "23",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/long_page.png"></img>
          ),
          label: "长页",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/biaodan",
=======
          key: "24",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/form.png"></img>
          ),
          label: "表单",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/hudong",
=======
          key: "25",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/interaction.png"></img>
          ),
          label: "互动",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/huace",
=======
          key: "26",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/E-book.png"></img>
          ),
          label: "电子画册",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/shiping",
=======
          key: "27",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/video.png"></img>
          ),
          label: "视频",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/ai",
=======
          key: "28",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/AI_creation.png"></img>
          ),
          label: "AI创作",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/shuzi",
=======
          key: "29",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/Digital_humans.png"></img>
          ),
          label: (
            <span style={{ display: "flex", alignItems: "center" }}>
              数字人
              <img
                style={{ width: "32px", height: "16px", marginLeft: "4px" }}
                src="/src/assets/image/home_page/side_menu/New.png"
              />
            </span>
          ),
        },
        {
          key: "220",
          icon: (
            <img src="/src/assets/image/home_page/side_menu/Mapping_tools.png"></img>
          ),
          label: "作图工具",
          children: [
<<<<<<< HEAD
            { key: "/home/free_templates/koutu", label: "智能抠图" },
=======
            { key: "2201", label: "智能抠图" },
>>>>>>> 040b22f (改版)
            { key: "2202", label: "智能海报" },
            { key: "2203", label: "拼图" },
            { key: "2204", label: "图片美化" },
            { key: "2205", label: "二维码美化" },
            { key: "2206", label: "文字云" },
            { key: "2207", label: "对话生成器" },
            { key: "2208", label: "格式转化器" },
            { key: "2209", label: "批量水印" },
          ],
        },
        {
          key: "221",
          icon: (
            <img src="/src/assets/image/home_page/side_menu/Marketing_tools.png"></img>
          ),
          label: "营销工具",
          children: [
            { key: "2211", label: "短信通知" },
            { key: "2212", label: "在线收款" },
            { key: "2213", label: "获客活码" },
            { key: "2214", label: "节日红包" },
            { key: "2215", label: "个人主页" },
          ],
        },
      ],
    },
    {
      key: "grp_three",
      type: "group",
      label: "其他",
      children: [
        {
<<<<<<< HEAD
          key: "/home/free_templates/anli",
=======
          key: "31",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/chat.jpg"></img>
          ),
          label: "案例中心",
        },

        {
<<<<<<< HEAD
          key: "/home/free_templates/zhengban",
=======
          key: "32",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/open_folder.jpg"></img>
          ),
          label: "正版素材",
        },
        {
<<<<<<< HEAD
          key: "/home/free_templates/sheji",
=======
          key: "33",
>>>>>>> 040b22f (改版)
          icon: (
            <img src="/src/assets/image/home_page/side_menu/user.jpg"></img>
          ),
          label: "成为设计师",
        },
      ],
    },
  ];

<<<<<<< HEAD
  const onClick: MenuProps["onClick"] = (e: any) => {
   console.log(e.key)
   navgite(e.key)
=======
  const onClick: MenuProps["onClick"] = (e) => {
    window.open(e.key);
>>>>>>> 040b22f (改版)
  };
  return (
    <div className="sidebar">
      <Menu
        onClick={onClick}
        style={{ width: 204 }}
<<<<<<< HEAD
        defaultSelectedKeys={["1"]}
        defaultOpenKeys={["sub1"]}
        mode="inline"
        items={items}

      >
        {/* <NavLink to={items.children.key}></NavLink> */}
      </Menu>
=======
        defaultSelectedKeys={[loaction.pathname]}
        defaultOpenKeys={["sub1"]}
        mode="inline"
        items={items}
      />
>>>>>>> 040b22f (改版)
    </div>
  );
};

export default Sidebar;
<<<<<<< HEAD


=======
>>>>>>> 040b22f (改版)
